<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp" %>
<script type="text/javascript">
	function preCreateService(){
		var treeId = $("#treeId").val();
		$.layer({
		    type: 2,
		    maxmin: true,
		    shadeClose: true,
		    title: '增加服务',
		    shade: [0.1,'#fff'],
		    offset: [($(window).height() / 15)+'px',''],
		    area: ['800px', '400px'],
		    iframe: {src: '${ctx}/communityServiceMange/preCreateService/'+treeId}
		}); 
	 	/* document.searchForm.action = '${ctx}/sortTree/listAllNode?treeId=' + treeId;
        document.searchForm.submit(); */
	}
	
	function preUpdateCommunityService(id){
		$.layer({
		    type: 2,
		    maxmin: true,
		    shadeClose: true,
		    title: '修改服务',
		    shade: [0.1,'#fff'],
		    offset: [($(window).height() / 15)+'px',''],
		    area: ['800px', '400px'],
		    iframe: {src: '${ctx}/communityServiceMange/preUpdateService/'+id}
		}); 
	}
	//点击删除一条记录
	function deleteCommunityService(id){
   		var str ="确定要删除该条记录吗？";
   		layer.confirm(str,function(){
   			$.ajax({
				url:'${ctx}/communityServiceMange/deleteService/'+id,
				type:'POST',
				cache:false,
				success:function(data){
					location.reload();
				}
			});
   		});
	}
	
	function clickSS(){
		document.getElementById("Image8").click(); 
		$("#Image8").click();
	}
	
	$(document).ready(function(){
		
		var tablename=document.getElementById("listOutTable");
		var li=tablename.getElementsByTagName("tr");
		for (var i=1;i<=li.length;i++){
		if (i%2==0){
		li[i].style.backgroundColor="#f6f6f6";
		}else li[i].style.backgroundColor="#FFFFFF";
		}

	});
</script>
</head>

<body>
<form action="${ctx}/communityServiceMange/listCommunityServiceMange/${communityId}" method="get" name="searchForm" id="searchForm">
<input type="hidden" id="treeId" name="treeId" value="${treeId}"/>
<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div><span>服务管理</span></div>
</div>
<div class='querycondition'>
	<div class='condtiontitle'><div class='searchcondition'></div>搜索条件：</div>
	<div class='condtion'>
		服务名称：<input id="filter_LIKES_productName" name="filter_LIKES_productName" value="${param['filter_LIKES_productName'] }" type="text" class="sell-textinput-02"/>
	    <%-- <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>  --%>
		<input name="image" type="image" id="Image8" style="display:none" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
		<input type='button' value='搜索'  class='button cyan medium' onclick="clickSS();"/>&nbsp;&nbsp;
		<input type='button' value='清空' class='button cyan medium' onclick="clearInput()"/>&nbsp;&nbsp;
		<input type="button" class='button cyan medium' onclick="preCreateService();" value="新增服务"/>
	</div>
</div>
		
		<%-- <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
		  <tr>
		    <td height="5" colspan="2"></td>
		  </tr>
			<tr>
				<td height="20" align="left" valign="middle">
		      		<input class="myButton" type="button" onclick="preCreateService();" value="新增服务"/>
		      	</td>
			</tr>
		    <tr>
		      <td height="20" align="left" valign="middle">
		      <img src="${baseURL}/images/009.png" width="16" height="16" align="absmiddle" />
		      &nbsp;搜索条件：&nbsp;
		      </td>
		    </tr>
		    <tr>
		      <td height="20" align="left" valign="middle">  
		      	服务名称：
		      	<input id="filter_LIKES_productName" name="filter_LIKES_productName" value="${param['filter_LIKES_productName'] }" type="text" class="sell-textinput-02"/>
		      </td>	
		    </tr>
		    <tr>
		      <td height="20" align="center" valign="middle">
		      <input name="image" type="image" id="Image8" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
		      &nbsp;&nbsp;&nbsp;&nbsp;
		      <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>
		      </td>
		    </tr>
		  <tr>
		    <td height="5" colspan="2"></td>
		  </tr>
		  <tr>
		    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
		  </tr>
		  <tr>
		    <td height="5" colspan="2" class="text_gray2"></td>
		  </tr>
		</table> --%>
</form>

<c:if test="${empty obj.list}">
<div align="center"><b>没有符合条件的记录。</b></div>
</c:if>
<c:if test="${not empty obj.list}">
<div class='userlist-title'>
	<div class='userlist-title-left'><div class='userlist-title-icon'></div><span>服务管理</span></div>
</div>
<div class='userlist'>
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" id="listOutTable">
	<tr align="center" bgcolor="#eeeeee">
		<td class='userlist-td operation' width="5%">编号</td>
		<td class='userlist-td operation' width="20%">服务名称</td>
		<td class='userlist-td operation' width="20%">服务费用</td>
		<td class='userlist-td operation' width="40%">说明</td>
		<td class='userlist-td operation'>操作</td>
	</tr>
	<c:forEach var="oneRow" items="${obj.list}">
		<tr align="center">
			<td class='userlist-td'>${oneRow.id}</td>
			<td class='userlist-td' align="left">${oneRow.productName}</td>
			<td class='userlist-td'>${oneRow.sellPrice}</td>
			<td class='userlist-td'>${oneRow.productContent}</td>
			<td class='userlist-td'>
				<a href="#" onclick="preUpdateCommunityService(${oneRow.id})">[修改服务]</a>
				<a href="#" onclick="deleteCommunityService(${oneRow.id})">[删除]</a>
			</td>
		</tr>
	</c:forEach>
  
</table>
<table>
  <tr>
    <td height="25" colspan="5"><%@ include file="../include/listpage.jsp"%>
    </td>
  </tr>
</table>
</div>
<script src="${ctx}/js/listCompanyUser.js"></script>
</c:if>

<%@ include file="../include/bottom.jsp"%>
</body>
</html>